package com.t4.courseware.controller;

import com.t4.courseware.common.Result;
import com.t4.courseware.service.ExchangeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("exchangeKey")
public class ExchangeController {

    @Autowired
    private ExchangeService exchangeService;

    @GetMapping("/use")
    public Result exchangeKey(@RequestParam(required = true) String key){
        return exchangeService.exchangeKey(key);
    }
}
